#include "ResString.h"

using namespace cocos2d;


ResString::ResString(void)
{
	ccLanguageType currentLanguageType = CCApplication::sharedApplication()->getCurrentLanguage();
	if(currentLanguageType == kLanguageChinese) {
		d_language = CCDictionary::createWithContentsOfFile("string/Str_CN.xml");
	} else {
		d_language = CCDictionary::createWithContentsOfFile("string/Str_EN.xml");
	}
	d_language->retain();
}

const char* ResString::getStr(char* key)
{
	//ccLanguageType currentLanguageType = CCApplication::sharedApplication()->getCurrentLanguage();
	//if(currentLanguageType == kLanguageChinese) {
	//	d_language = CCDictionary::createWithContentsOfFile("Str_CN.xml");
	//} else {
	//	d_language = CCDictionary::createWithContentsOfFile("Str_EN.xml");
	//}
	return ((CCString*)d_language->objectForKey(key))->m_sString.c_str();
}
